package com.usian.article.controller.v1;


import com.usian.apis.article.ApArticleControllerApis;
import com.usian.article.service.ApArticleService;
import com.usian.model.article.dtos.ArticleInfoDto;
import com.usian.model.article.pojos.ApArticle;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/article")
public class ApArticleController implements ApArticleControllerApis {

    @Autowired
    private ApArticleService apArticleService;

    @Override
    @PostMapping("save")
    public ApArticle saveArticle(@RequestBody ApArticle apArticle) {
        apArticleService.save(apArticle);
        return apArticle;
    }

    @Override
    @PostMapping("load_article_behavior")
    public ResponseResult loadArticleBehavior(@RequestBody ArticleInfoDto dto) {
        return apArticleService.loadArticleBehavior(dto);
    }
}
